<template>
    <view class="content">
        <van-nav-bar :title="scrolling ? navBarTitle : ''" left-arrow @click-left="onClickLeft" class="navBar">
        </van-nav-bar>
        <view style="padding: 0rpx 0rpx 20rpx 0rpx;" class="search-box">
            <view class="search-container">
                <van-search :value="searchText" placeholder="请输入商品名称/订单编号" @search="onSearch" @cancel="onCancel"
                    @change="onChange" @clear="clearSearchData" shape="round" :use-action-slot="isShow" custom-class="search-style"
                    background="transparent">
                    <view slot="action" @tap="onClick">搜索</view>
                </van-search>
            </view>
        </view>
        <scroll-view class="scroll-content" scroll-y :lower-threshold="80" @scroll="scrollPage" show-scrollbar="false">
            <view class="history" hover-class="none" hover-stop-propagation="false" v-if="(searchText === '' ||  showHistory) && historyList.length>0">
                <view class="historyTitle" hover-class="none" hover-stop-propagation="false">
                    <view>历史搜索</view>
                    <view class="delete" @tap="delHistory"><img
                            src="https://17lelife-bucket.oss-cn-beijing.aliyuncs.com/WeChat-App-Picture/deleteScanData.png"
                            alt=""></view>
                </view>
                <view class="historyList">
                    <view class="coupon-item" style="display: flex; flex-wrap: wrap;">
                        <view class="coupon-type" v-for="(item, index) in historyList" :key="index"
                            @click="selectHistory(item.keyword, index, $event)">{{ item.keyword }}</view>
                    </view>
                </view>
            </view>
            <view class="search-box" v-if="searchText !== ''">
                <template v-if="hasData">
                    <orderList :orderList="searchList" :activeTab="activeTab" 
                    @addToCart="addToCart"
                    @submitAnotherOrder="submitAnotherOrder"
                    @delOrder="delOrder"
                    @toJudge="toJudge" @toFollowUpJudge="toFollowUpJudge" @openCheckShouhuo="openCheckShouhuo"
                    @cancelOrder="cancelOrder"
                    :source="source"></orderList>
          
                </template>
                <template v-else>
                    <view class="noOrderPic">
                        <van-empty class="custom-image"
                            image="https://17lelife-bucket.oss-cn-beijing.aliyuncs.com/WeChat-App-Picture/noOrder.png" />
                    </view>
                    <view class="orderTip" style="font-size: 32rpx; font-weight: normal;">您还没有相关订单</view>
                </template>
            </view>
        </scroll-view>
        <van-dialog id="van-dialog" confirm-button-color='#ff6203' />
        <cancelOrder :show="cancelPopup" @closeCancelPopup="closeCancelPopup" :orderId="orderId"></cancelOrder>
        <isShouhuoPopup :show="isShouhuoPopupShow" :orderId="orderId" @closeShouhuo="closeShouhuo" @confirmShouhuo="confirmShouhuo"></isShouhuoPopup>
    </view>
</template>

<script>
import Dialog from '@/wxcomponents/vant/dialog/dialog'
import cancelOrder from '@/mycomponents/shangcheng/cancelOrder.vue'
import isShouhuoPopup from '@/mycomponents/shangcheng/isShouhuoPopup.vue'
import {deleteOrderKeywordsApi,getOrderKeywordsApi,searchOrderApi,deleteOrderApi,cancelOrderApi,getOrderDetailApi,batchAddToShoppingCartApi} from '@/api/order'
import { SOURCE_TYPE } from '@/utils/constant'
import orderList from '@/mycomponents/orderList.vue'

export default {
    components: {
        cancelOrder,
        isShouhuoPopup,
        orderList
    },
    data () {
        return {
            navBarTitle: '搜索',
            scrolling: false,
            searchText: '',
            message: '',
            searchview: false,
            //一个订单多个商品手写轮播图
            swiperCurrent: 0,
            tabCurrent: 'tabNum1',
            showHistory: true,
            historyList: [],
            isShow: 'true', // 是否显示搜索按钮
            searchList: [],
            list: [],
            params: undefined, // 接受从路由传过来的参数
            cancelParams:{},
            popoverShow: false,
            current: 0,
            bubbleTop: 0,
            bubbleLeft: 0,
            popupDisplay:'none',
            popupCurrent:-1,  //弹窗里面的选项
            cancelPopup:false, //取消订单原因弹窗
            isShouhuoPopupShow:false, //确认收货弹窗
            orderId:'', //订单id
            pageNum: 1,
            pageSize: 10,
            totalPages: 0,
            hasMore: true,
            total:0,
            hasData:true,
            scrollTop: 0, // 新增：用于存储滚动位置
            allHistoryIdList: [], // 所有历史记录的id
            source:SOURCE_TYPE.SEARCH_ORDER,
            // afterSalesStatusText: {
            //     0: "提交申请",
            //     1: "平台审核中",  //平台审核
            //     2: "待送自提点",
            //     3: "平台处理中",
            //     4: "已完成",
            //     5: "申请平台未通过", //拒绝申请
            //     6: "已撤销，退款关闭" //取消申请
            // },
            orderStatus:-1,
            activeTab: 0,
        }
    },
    onLoad (data) {
        if (data !== null) { }
    },
    onReady () {

    },
    onShow(){
        // 订单搜索关键字  搜索关键字历史
        this.getOrderKeywordsList()
    },
    methods: {
        // 滑动
        scrollPage (e) {
            console.log(e.detail.scrollTop, this.scrolling)
            if (e.detail.scrollTop > 25 && !this.scrolling) {
                this.scrolling = true
            } else if ((e.detail.scrollTop <= 25 && this.scrolling) || (e.detail.scrollTop <= 25 && !this.scrolling)) {
                this.scrolling = false
            }
        },
        // 返回键
        onClickLeft () {
            uni.navigateBack()
        },
        // 删除历史记录
        delHistory () {
            deleteOrderKeywordsApi(this.allHistoryIdList).then(res => {
                console.log(res, '删除历史记录')
                if (res.code == 200) {
                    this.showHistory = false
                    this.historyList = []
                }
            })
        },
        // 搜索关键字
        onSearch (e) {
            console.log(e, 'search')
            this.searchText = e.detail
            if (this.searchText.trim() == '') {
                wx.showToast({
                    title: '请输入搜索内容',
                    icon: 'none'
                })
                this.searchview = false
                this.searchResult = []
                this.isShow = true
            } else {
                this.isShow = false
                console.log(this.searchText, typeof (this.searchText))
                this.showHistory =  false
                this.searchList=[]
                this.searchOrderList()
            }
        },
        //状态码转换方法
        getOrderStatusText(status) {
            switch (status?.toString()) {
                case '-1': return '全部订单';
                case '0': return '待发货';
                case '1': return '待收货';
                case '2': return '已收货，待评价';
                case '3': return '已完成';
                case '4': return '等待买家付款';
                case '5': return '交易关闭'; //已取消，交易关闭
                case '6': return '待使用';
                case '7': return '交易关闭'; //待支付 超时未支付  申请售后成功
                case '8': return '退款/售后';
                case '9': return '已删除';  //订单已删除
                case '10': return '待收货';  //已签收的状态   但是订单是还未确认收货的状态  所以实质上是跟待收货一样的
                default: return '未知状态';
            }
        },
        // 新增物流状态转换方法
        formatLogisticStatus(status) {
            const map = {
                'ORDER_PAID': '已下单',
                'ORDER_CREATED': '已下单',
                'PROCESSING': '仓库处理中',
                'WAREHOUSE_PROCESSING': '仓库处理中',
                'IN_TRANSIT': '运输中',
                'ARRIVED': '已到达自提点',
                'ARRIVED_AT_PICKUP_POINT': '已到达自提点',
                'DELIVERED': '已签收',
                'PICKED_UP': '已签收',
                'CANCELLED': '已取消',
            };
            return map[status] || status; // 保留未知状态原样显示
        },

        // 边输边搜
        onChange (e) {
            console.log(e.detail, 'onchange')
            // this.searchText = e.detail
            // this.isShow = true
            // if (this.searchText.trim() === '') {
            //     this.searchview = false
            //     this.searchResult = []
            //     return
            // }
            // this.showHistory =  false
            // console.log(this.searchText, typeof (this.searchText))
            // this.searchOrderList()
            // // const searchResult = this.list.filter(item => {
            // //     return item.orderId.includes(this.message)
            // // })

            // // if (searchResult.length > 0) {
            // //     this.searchview = true
            // //     this.searchList = searchResult
            // // } else {
            // //     this.searchview = false
            // //     this.searchList = []
            // // }
        },

        onClick (event) {
            console.log('点击事件触发', event,'onClick')
            console.log(this.searchText)
            if (this.searchText.trim() === '') {
                wx.showToast({
                    title: '请输入搜索内容',
                    icon: 'none'
                })
                this.isShow = true
            } else {
                this.isShow = false
                this.showHistory =  false
                this.searchList=[]
                this.searchOrderList()
            }

            // const searchResult = this.list.filter(item => {
            //     return item.orderId.includes(this.value)
            // })
            // if (searchResult.length > 0) {
            //     this.searchview = true
            //     this.searchList = searchResult
            //     // this.setData({
            //     //     searchview: true,
            //     //     searchList: searchResult
            //     // }, () => {
            //     //     // 在动态渲染完成后，滚动到搜索结果视图
            //     //     this.setData({
            //     //     scrollIntoView: 'searchResultView'
            //     //     });
            //     // });
            // } else {
            //     wx.showToast({
            //         title: '未找到相关商品',
            //         icon: 'none'
            //     })
            // }
        },

        // 搜索清空
        clearSearchData () {
            this.searchText = ''
            this.searchview = false
            this.searchResult = []
            this.getOrderKeywordsList()
        },
        // 搜索取消
        onCancel () { },

        // 点击历史记录
        selectHistory (text, val, e) {
            console.log(text, val, e, '选择历史记录')
            this.searchText = text
            this.isShow = false
            this.showHistory = false
            this.searchList=[]
            this.searchOrderList()
        },

        // 一个订单多个商品 轮播展示
        lookInfo(index,e,item){
			this.swiperCurrent = index
            console.log(index, item, '组件', this.tabCurrent, 'tabCurrent++', this.swiperCurrent)
		},
        // 跳转商品详情页面
        // 跳转商品详情
        toOrderDetail (item, status) {
            console.log(item, 'toOrderDetail', status)
            const params = {}
            params.item = item
            params.id = item.orderNo
            params.orderStatus = status
            params.orderNo = item.orderNo
            params.orderId = item.orderId
            params.source = this.source
            console.log(params, 'params---')
            // if (status == 4) { //待付款
            //     params.status = 'unpaid'
            // } else if (status == 0) { //待发货
            //     params.status = 'unshipped'
            // } else if (status == 1) { //待收货
            //     params.status = 'unreceived'
            // } else if (status == 2) { //待评价
            //     params.status = 'unrewied'
            // } else if (status == 7) { //售后
            //     params.status = 'refund'
            // }
            if(item.orderType == '1'){  //服务  待使用服务
                uni.navigateTo({
                    url:
                        '/pages/orders/awaitUseService?params=' +
                        encodeURIComponent(JSON.stringify(params))
                })
            }else if(item.orderType =='0'){  //订单状态-1:全部订单; 0：待发货；1：待收货；2：已收货，待评价；3：已完成；4:待付款 5: 已取消  6: 待使用
            //  订单状态（-1:全部订单; 0：待发货；1：待收货；2：已收货，待评价；3：已完成；4:待付款 5: 已取消  6: 待使用 7:售后/退款)
                // if (status == 7 ) { //售后
                //     uni.navigateTo({
                //         url:
                //             '/pages/orders/refundOrderDetail?params=' +
                //             encodeURIComponent(JSON.stringify(params))
                //     })
                // }else if(status == 2 || status == 1 || status == 3){  //待收货1  待评价 2 已完成3 
                //     uni.navigateTo({
                //         url:
                //             '/pages/orders/judgeOrderDetail?params=' +
                //             encodeURIComponent(JSON.stringify(params))
                //     })
                // }else {  //待付款 4 待发货 0 已取消 5（跟付款无关的取消）
                    uni.navigateTo({
                        url:
                            '/pages/orders/orderDetails?params=' +
                            encodeURIComponent(JSON.stringify(params))
                    })
                // }
            }

        },

        // 更多  气泡卡片
        popover (orderNum) {
            //this.popoverShow = !this.popoverShow
            //this.current = val
            const query = wx.createSelectorQuery().in(this);
            query.select('.moreButton').boundingClientRect((rect) => {
                wx.pageScrollTo({
                    scrollTop: 0,
                    selector: '.btnAreaLeft'
                });
                wx.getSystemInfo({
                    success: (res) => {
                        const scrollTop = wx.pageScrollTo().scrollTop;
                        console.log(scrollTop,'scrollTop')
                        this.bubbleTop = rect.top + scrollTop + rect.height;
                        this.bubbleLeft = rect.left;
                        this.current = orderNum;
                        this.popoverShow = !this.popoverShow;
                    }
                });
            }).exec();
            this.popupCurrent=-1
        },
        // 申请发票
        showTaxInvoice(){
            this.popupCurrent=0
            this.popoverShow=false
            uni.navigateTo({
                url:'/pages/orders/taxInvoice'
            })
        },
        // 取消订单
        cancelOrder(){
            this.popupCurrent=1
            this.popoverShow=false
            this.cancelPopup=true
        },
        // 关闭取消订单原因  并跳转取消订单的详情页面
        closeCancelPopup(isCancel,sign){
            this.cancelPopup=false

            if (sign == 'submit') {
                uni.navigateTo({
                    url: '/pages/orders/orderDetails'
                })
            }
        },
        // 修改地址
        changeAddress (val,status,orderId) {
            const params = {
                house:val,
                myHouse:true,
                orderStatus:status,
                orderId:orderId,
                source:this.source
            }
            uni.navigateTo({
                url: '/pages/orders/orderDetails?params=' +
                    encodeURIComponent(JSON.stringify(params))
            })
        },
         //   跳转 物流详情
         toLogisticsDetail (item) {
            if(item.orderStatus == 4){
                return
            }
            console.log(item.orderStatus, 'toLogisticsDetail')  
            const params = {
                orderNo:item.orderNo,
                orderId:item.orderId,
                orderStatus:item.orderStatus,
                source:this.source
            }
            uni.navigateTo({
                url:
                    '/pages/orders/logisticsDetail?params=' +
                    encodeURIComponent(JSON.stringify(params))
            })
        },
        // 计入购物车   待付款订单
        async addToCart (item) {
            console.log(item, 'addToCart')
            const params = {
                orderId: item.orderId,
                productAttrValueId:item.orderProducts[0].productAttrValueId,
                productAttrName:item.orderProducts[0].productAttrName,
                showSpecsPopup : true,
            }
            if (item.orderType === 1) {
               uni.navigateTo({
                    url: '/pages/service/serviceDetail?params=' +
                        encodeURIComponent(JSON.stringify(params))
                })
                return false
            }
            const cartParams = item.orderProducts.map(product => ({
                    cartId: undefined,
                    cartNum: product.num,  // 使用每个商品自己的购买数量
                    cartType: "NORMAL",
                    productAttrValueId: product.productAttrValueId,
                    productId: product.productId,
                    selected: true
                })
            )
            console.log(cartParams, 'addToCart')
            const res = await batchAddToShoppingCartApi(cartParams)
            if (res.code == 200) {
                uni.navigateTo({
                    url: '/pages/shoppingCart/gouwuche?params=' +
                        encodeURIComponent(JSON.stringify(params))
                })
                wx.showToast({
                    title: '加入购物车成功',
                    icon: 'none',
                    duration: 2000
                })
            }
        },
        
        // 服务商品 再次购买 
        submitAnotherOrder(item) {
          const params = {
            orderId: item.orderId,
            source: this.source,
            pageSymbol:'serviceGoods',
            productId: item.orderProducts[0].productId,
          }
          // params.showSpecsPopup = true
          uni.navigateTo({
            url: '/pages/service/serviceDetail?params=' +
              encodeURIComponent(JSON.stringify(params))
          })
        },

         // 删除订单记录
         delOrder (orderId) {
            Dialog.confirm({
                message: '确认删除记录'
            }).then(() => {
                deleteOrderApi(orderId).then(res => {
                    if (res.code == 200) {
                        wx.showToast({
                            title: '删除成功',
                            icon: 'none',
                            duration: 2000
                        })
                        this.searchOrderList()
                    }
                })
            })
            .catch(() => {
                console.log('cancel')
            })
        },
        // 继续付款
        toPayment (item) {
            const params = {}
            params.orderNum = item.orderNo
            params.orderId = item.orderId
            params.orderStatus = item.orderStatus
            params.totalAmount = item.actualTotalPayAmount
            params.isPay = false
            params.source = this.source
            uni.navigateTo({
                url: '/pages/payment/cashPage?params=' +
                    encodeURIComponent(JSON.stringify(params))
            })
        },
        // 去评价
        async toJudge(item){
            const params ={
                source:this.source,
                orderId:item.orderId,
                orderType:item.orderType
            }
            try {
                const res = await getOrderDetailApi(item.orderId)
                if (res.code === 200) {
                    params.productInfoList = res.data.ordeDetailProductInfoList
                    uni.navigateTo({
                        url: '/pages/userJudges/sendJudge?params=' +
                            encodeURIComponent(JSON.stringify(params))
                    })
                }
            }catch (error) {
                console.error('获取订单详情失败:', error)
            }
        },
        // 去追评
        async toFollowUpJudge(item){
            const params ={
                source:this.source,
                orderId:item.orderId,
                orderType:item.orderType,
            }
            // 检查 commentIdMap 是否存在
            if (item.commentIdMap) {
                const keys = Object.keys(item.commentIdMap);
                if (keys.length > 0) {
                    // 使用方括号语法获取值
                    params.commentId = item.commentIdMap[keys[0]];
                }
            }
            try {
                const res = await getOrderDetailApi(item.orderId)
                if (res.code === 200) {
                    params.productInfoList = res.data.ordeDetailProductInfoList
                    uni.navigateTo({
                        url: '/pages/userJudges/followUpJudge?params=' +
                            encodeURIComponent(JSON.stringify(params))
                    })
                }
            }catch (error) {
                console.error('获取订单详情失败:', error)
            }
        },
        // 打开确认收货
        openCheckShouhuo (item) {
            console.log(item, 'openCheckShouhuo')
            this.orderId = item.orderId
            this.isShouhuoPopupShow = true
        },
        // 关闭确认收货弹窗
        closeShouhuo(){
            this.isShouhuoPopupShow=false
        },
        // 确认收货弹窗确认按钮
        async confirmShouhuo(item){
            this.isShouhuoPopupShow=false
            console.log(item,'confirmShouhuo')
            this.pageNum = 1
            this.total = 0
            this.orderList = []
            this.loading = false
            this.finished = false
            this.hasMore = true
            this.getMyOrderList()
        },
         // 取消订单
         cancelOrder(item){
            this.popupCurrent=1
            this.popoverShow=false
            this.cancelPopup=true
            this.orderId = item.orderId
            this.cancelParams = item
        },
        // 关闭取消订单原因  并跳转取消订单的详情页面
        closeCancelPopup(isCancel,sign){
            console.log(isCancel,sign,'关闭取消订单')
            this.cancelPopup=false

            if (sign == 'submit') {
                const params = {}
                params.item = this.cancelParams
                params.orderStatus = this.cancelParams.orderStatus
                params.orderNo = this.cancelParams.orderNo
                params.orderId = this.cancelParams.orderId
                params.source = this.source
                uni.navigateTo({
                    url: '/pages/orders/orderDetails?params=' +
                            encodeURIComponent(JSON.stringify(params))
                })
            }
        },
        /**
         * 接口
         */

        // 搜索按钮 searchOrderApi
        searchOrderList () {
            searchOrderApi({searchText:this.searchText}).then((res)=>{
                if(res.code==200){
                    this.searchList = res.data?.list || res?.data || []
                    if (this.searchList.length > 0) {
                        this.hasData = true
                    }else{
                        this.hasData = false
                    }
                    console.log(this.searchList,'searchList')
                }
            })
        },
        // 查询订单搜索关键字
        getOrderKeywordsList () {
            getOrderKeywordsApi().then((res)=>{
                if(res.code==200){
                    this.historyList = res.data
                    console.log(this.historyList,'historyList')
                    this.allHistoryIdList = res.data.map(item => item.id);
                }
            })
        },
    }
}
</script>

<style lang="scss" scoped>
.content {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: calc(0rpx + env(safe-area-inset-bottom));
}

.scroll-content {
    flex: 1;
    height: 1px;
}

.search-container {
    width: calc(100% - 48px);
    margin-left: 24px;
    margin-right: 24px;
    background-color: #f9f9f9;
    /* 背景颜色 */
    border-radius: 33px;
    /* 圆角边框 */
}

.search-style {
    background-color: transparent;
    /* 搜索框背景透明 */
    border-radius: 20px;
    /* 圆角边框 */
    padding: 0 40px 0 10px;
    /* 内边距，为"搜索"二字留出空间 */
}

// .search-style__cancel {
//     color: #333; /* 取消按钮字体颜色 */
// }

// .search-style__input {
//   color: #333; /* 输入框字体颜色 */
//   font-size: 16px; /* 字体大小 */
// }

// /* 这段样式是为了在输入框前添加文字 "搜索" */
// .search-style__label {
//   position: absolute;
//   left: 10px;
//   top: 50%;
//   transform: translateY(-50%);
//   color: #999; /* 标签字体颜色 */
//   font-size: 14px; /* 字体大小 */
// }

.search-box {
    // margin-top: 36px;
}

.history {
    padding: 24px;
}

.historyTitle {
    font-size: 14px;
    text-align: left;
    color: #111111;
    line-height: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;


    .delete{
        width: 40rpx;
        height: 40rpx;
        padding-right: 16rpx;
        img{
            width: 40rpx;
            height: 40rpx;
        }
    }
}

.historyList {
    // padding-left: 24px;
    // padding-right: 24px;
    padding-top: 16px;
}

.coupon-type {
    color: #111111;
    font-size: 12px;
    background: #f9f9f9;
    margin-right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10rpx;
}
.orderList_bg{
    background:#f9f9f9;
    padding-bottom:5px;
}
.orderList {
    padding: 24px 24px 15px 24px;
    background-color: #ffffff;
    width: calc(100% - 48px);

    // 待付款
    .orderTop {
        display: flex;
        align-items: center;
    }

    // 有复选框  右侧商品的样式
    .orderTopRight {
        width: 100%;
    }

    // 已付款
    .listTop {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .listTopLeft {
            font-size: 26rpx;
            color: #666666;
            line-height: 26rpx;
            text-align: left;
        }

        .listTopRight {
            color: #FF6203;
            text-align: right;
            line-height: 26rpx;
            font-size: 26rpx;
        }
    }

    .goodsDetail {
        margin-top: 11px;
        width: 100%;

        .wraper_left {
            display: flex;
            width: 100%;
            margin-bottom: 11px;
        }

        .wraper_left:last-child {
            margin-bottom: 0px;
        }


        .goodsPic {
            width: 33%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            img {
                width: 100%;
                height: auto;
            }
        }

        .goods_tips {
            margin-top: 12rpx;
            font-size: 22rpx;
            text-align: left;
            color: #888888;
            line-height: 22rpx;
        }
    }

    //一个订单商品超过2个  横向滚动
    .goodsListWrapper {
        position: relative;
        width: 80%;
    }
    .wraper_products_info{
        display: flex;
        width: 100%;
    }
    .hotSale_content {
        position: relative;
        display: flex;

        .shangpinList {
            // flex: 1;
            width: 26%;
            // margin-bottom: 12px;
            background: #ffffff;
            // width: 121px;
            // height: 226px;

            .renqi_img {
                position: relative;
                width: 100%;

                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                // width: 121px;
                // height: 121px;
                // line-height: 121px;

                img {
                    width: 100%;
                    height: auto;
                }
            }

            .status_tips {
                position: absolute;
                height: 100%;
                width: 100%;
                background: rgb(0, 0, 0, 0.60);
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                height: 100%;
                font-size: 20rpx;
                color: #ffffff;
                bottom: 0px;
            }

        }
    }

    // 热卖推荐轮播组件
    .top-menu-view {
        display: flex;
        // position: fixed;
        white-space: nowrap;
        width: 100%;

        .shangpinList {
            // width: 120px;
            display: inline-block;
            // white-space: nowrap;
            margin-right: 6px;
            position: relative;
        }

        // .shangpinList:last-child {
        //     // margin-right:16px;
        // }
    }

    .fixDiv {
        min-height: 226px;
        width: 10px;
        right: 0px;
        background: linear-gradient(270deg, #ffffff 25.52%, rgba(255, 255, 255, 0) 100%);
        position: absolute;
        z-index: 1;
    }

    .last-top-menu-view {
        // width: calc(100% - 46px);
    }

    ::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
        color: transparent;
    }

    // 物流
    .logistics {
        background: #f9f9f9;
        display: flex;
        align-items: center;
        padding: 20rpx;
        margin-top: 11px;
        width: calc(100% - 40rpx);

        .logistics_status {
            font-size: 22rpx;
            color: #111111;
            margin-left: 16rpx;
            width: calc(100% - 54rpx);
            white-space: nowrap;
            /* 防止文本换行 */
            overflow: hidden;
            /* 超出部分隐藏 */
            text-overflow: ellipsis;
            /* 显示省略号 */
        }

        .logistics_detail {
            width: 100%;
            font-size: 22rpx;
            color: #111111;
            line-height: 22rpx;
            margin-left: 11px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;

        }
    }
}


.goodsText {
    position: relative;
    width: 67%;
    margin-left: 14px;
    // width: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 12rpx;
    padding-bottom: 20rpx;
    text-align: left;

    .goodsText_top {
        display: flex;
        flex-direction: column;
        .goodsTop {
            // position: absolute;
            // top: 2%;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;

            .goods_T {
                max-width: 80%;
                font-size: 28rpx;
                text-align: left;
                color: #111111;
                line-height: 28rpx;
                // margin-top: 9px;  //display：flex   中 元素居中
                white-space: nowrap;
                /* 防止文本换行 */
                overflow: hidden;
                /* 超出部分隐藏 */
                text-overflow: ellipsis;
                /* 显示省略号 */
            }

            // 商品价格
            .goods_price {
                font-size: 28rpx;
                // color: #737373;
                color: #111111;
                line-height: 28rpx;
            }
        }

        .goodsMiddle {
            // position: absolute;
            // top: 20%;
            margin-top: 20rpx;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;

            .goods_specs {
                // margin-top: 7px;
                max-width: 80%;
                font-size: 22rpx;
                text-align: left;
                color: #666666;
                //   line-height: 11px;

                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: normal;
            }

            .goods_num {
                font-size: 22rpx;
                line-height: 22rpx;
                color: #666666;
            }
        }
    }


    .goodsText_bottom {
        // position: absolute;
        // bottom: 10%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        //   max-width: 90%;
        // margin-top: 30px;

        // .money{
        //   font-size: 14px;
        //   text-align: left;
        //   color: #737373;
        //   line-height: 14px;
        //   // margin-right: 21px;
        // }
        .jifen_box {
            font-size: 28rpx;
            text-align: left;
            color: #999999;
            line-height: 28rpx;
            height: 28rpx;
        }

        .judgeBtn {
            border: 1px solid #FF6203;
            border-radius: 20px;
            font-size: 24rpx;
            text-align: center;
            color: #FF6203;
            line-height: 24rpx;
            padding: 5px 13px;
        }
    }
}

// 多个商品订单右侧的 价格+数量
.goodsListText{
    width: 20%;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: rgb(255, 255, 255, 0.66);

    .goods_price{
        color: #333333;
        font-size: 28rpx;
        line-height: 28rpx;
    }
    .goods_num{
        font-size: 22rpx;
        color: #666666;
        line-height: 22rpx;
        margin-top: 24rpx;
    }
}
// 多个商品的样式
.goodsDetailInfo_wrapper{
    display: flex;
    width: 100%;
    margin-bottom: 11px;
}

.btnArea {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .btnAreaLeft {
        color: #888888;
        font-size: 11px;
        line-height: 11px;
    }

    .btnAreaRight {
        display: flex;
        justify-content: space-between;

        .grayBtn {
            background-color: #Ffffff;
            border-radius: 38px;
            font-size: 14px;
            text-align: center;
            color: #D4D4D4;
            height: 62rpx;
            line-height: 60rpx;
            border: 1rpx solid #D4D4D4;
            padding-left: 10px;
            padding-right: 10px;
            margin-right: 12px;
        }

        // 黑字灰框按钮
        .blackBtn {
            background-color: #Ffffff;
            border-radius: 38px;
            font-size: 14px;
            text-align: center;
            color: #111111;
            height: 60rpx;
            line-height: 60rpx;
            border: 1px solid #D4D4D4;
            padding-left: 10px;
            padding-right: 10px;
            margin-right: 12px;
        }
        // 黑字黑框按钮
        .blackBlackBtn {
            background-color: #Ffffff;
            border-radius: 38px;
            font-size: 28rpx;
            text-align: center;
            color: #111111;
            height: 62rpx;
            line-height: 60rpx;
            border: 1px solid #111111;
            padding-left: 10px;
            padding-right: 10px;
            min-width: 156rpx;
        }
        // 红字红框
        .submitBtn {
            background-color: transparent;
            border-radius: 38px;
            font-size: 14px;
            text-align: center;
            color: #FF6203;
            height: 60rpx;
            line-height: 60rpx;
            border: 1px solid #FF6203;
            padding-left: 10px;
            padding-right: 10px;

        }

        button {
            border: none;
        }
    }
}
.noOrderPic {
    width: 100%;
    text-align: center;

    img {
        width: 81px;
        height: 85px;
    }
}
.orderTip {
    font-weight: bolder;
    font-size: 40rpx;
    text-align: center;
    color: #111111;
}
::v-deep .van-nav-bar__left {
    width: 56px;
    height: 44px;
}

::v-deep .navBar .van-icon {
    color: #242629 !important;
}

::v-deep .van-search {
    padding: 0px;
    background: transparent;
}

::v-deep .van-search--withaction {
    background: transparent;

}

::v-deep .van-search__content {
    background-color: transparent;
    // padding-left: 0px !important;
}

::v-deep .van-search__content--round {}

::v-deep .van-search__action {
    border-radius: 20px;
    background: #ff6203;
    font-size: 12px;
    color: #ffffff !important;
    height: 20px;
    line-height: 20px;
    margin-right: 10px;
}

::v-deep .van-icon-search {
    color: #888888;
}

.t16 {
    margin-top: 16px;
}

.t21 {
    margin-top: 21px;
}
.r12 {
    margin-right: 24rpx;
}

// 气泡卡片
.bubble_card {
    width: 180rpx;
    // max-height: 60vh; /* 防止超出屏幕 */
    // overflow-y: auto; /* 内容过多时显示滚动条 */
    z-index: 1000;
    position: absolute;
    display: inline-block;
    background-color: #fff;
    border-radius: 8px;
    margin-top: 11px;
    box-shadow: 0 0 11px rgba(0, 0, 0, 0.2);
}

.bubble_card::before {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
    position: absolute;
    top: -10px;
    left: 25%;
    transform: translateX(-50%);
    content: " ";
    position: absolute;
    // box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
//   width: 0;
//   height: 0;
//   border-style: solid;
//   border-width: 0 8px 8px 8px ;
//   border-color: transparent transparent #e10707  transparent;
// //   left: 50%;
// //   margin-left: -5px;
//     top: -8px;
//     filter: drop - shadow(0 2px 4px rgba(0,0,0,0.3));
//     // filter: drop-shadow(-2px 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
//     // clip-path: polygon(0% 0%, 100% 0%, 50% 100%); /* 定义三角形裁剪路径 */
}
// .bubble_card::after {
//     content: "";
//     position: absolute;
//     width: 0;
//     height: 0;
//     border-style: solid;
//     border-width: 0 8px 8px 8px ;
//     border-color: transparent transparent #fff  transparent;
//     top: -8px;
//     -webkit-filter: drop - shadow(0 2px 4px rgba(0,0,0,0.3));
//     filter: drop - shadow(0 2px 4px rgba(0,0,0,0.3));
//     z-index: 2;
//     clip-path: polygon(0% 0%, 100% 0%, 50% 100%); /* 根据三角形形状调整裁剪路径 */
// }

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.bubble-content {
    text-align: center;
    // padding:0rpx 6rpx;
}
.bubble {
  position: relative;
  background-color: #f2f2f2; /* 气泡窗背景颜色 */
  border-radius: 10px; /* 气泡窗圆角 */
  padding: 10px; /* 气泡窗内边距 */
  box-shadow: 0 0 5px #ccc; /* 气泡窗阴影 */
}
 
.bubble cover-image {
  width: 81px;
  height: 35px;
  position: absolute;
  top: 10px;
//   left: -60px; /* 根据图片大小调整 */
}
 
.bubble text {
  font-size: 22rpx;
  color: #111111;
}

.borderbottom {
    border-bottom: 1px solid #f9f9f9;
}

.activePopup {
    // background-color: #f9f9f9;
    color: #FF6203;
}
</style>
